<template></template>
<script  lang="ts" setup>
import { userStore, systemStore, audioStore } from "@/stores"

const system = systemStore()

system._rpxWidth = uni.$tm.u.torpx(system.systemInfo.windowWidth)
system._rpxHeight = uni.$tm.u.torpx(system.systemInfo.windowHeight)


onBeforeMount(() => {
  // #ifdef APP-PLUS-NVUE | APP-PLUS
  const domModule = weex.requireModule('dom');
  domModule.addRule('fontFace', {
    fontFamily: 'iconfont',
    src: "url('./static/iconfont/iconfont.ttf')"
  });
  domModule.addRule("fontFace", {
    fontFamily: "myicon", //注意这里必须是驼峰命名，跟上面的css样式对照
    src: "url('./static/iconfont/iconfont.ttf')",
  });
  // #endif
})

onLaunch(() => {
  // #ifdef APP-NVUE || APP-PLUS
  audioStore().onDestroyAudio()
  audioStore().onInitAudio()
  // #endif
  if (uni.getStorageSync('cookie')) {
    userStore().onGetUserInfo()
  }
})

onUnload(() => {
  // #ifdef APP-NVUE | APP-PLUS
  // #endif
})
</script>
<style lang="scss">
.iconfont {
  font-family: iconfont;
}

/* #ifndef H5 */
@import 'https://at.alicdn.com/t/c/font_3414885_m3zcxe0hmen.css';
/* #endif */

/* #ifdef APP-PLUS-NVUE */
@import './tmui/scss/nvue.css';
/* #endif */
/* #ifndef APP-PLUS-NVUE */
@import './tmui/scss/noNvue.css';
/* #endif */
</style>